<fieldset style="border:none;">
	<legend></legend>
	<div >
		<input type="hidden" name="api.id" value="#(api.id??)" />
		<div class="layui-form-item">
			<div class="layui-inline col-12 col-sm-24"> 
				<label class="layui-form-label col-6 col-sm-6">类型</label>
				<div class="layui-input-inline col-18 col-sm-16">
					<select id="userID" name="api.type" lay-filter="changeType" lay-verify="requite">
						#@option(typeList,"dmz","dmsm",api.type??,false)
					</select>
				</div>
			</div>
			<div class="layui-inline col-12 col-sm-24">
				<label class="layui-form-label col-6 col-sm-6">接口名称</label>
				<div class="layui-input-inline col-18 col-sm-16">
					<input type="text" name="api.name" value="#(api.name??)" lay-verify="requite" autocomplete="off" placeholder="请输入接口名称" class="layui-input">
				</div>
			</div>
		</div>

		<div class="layui-form-item"> 
			<label class="layui-form-label col-3 col-sm-6">接口描述</label> 
			<div class="layui-input-inline col-21 col-sm-16"> 
				<input type="text" name="api.desc" value="#(api.desc??)" lay-verify="requite" autocomplete="off" placeholder="请输入接口描述" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item"> 
			<label class="layui-form-label col-3 col-sm-6">接口详细说明</label> 
			<div class="layui-input-inline col-21 col-sm-16"> 
				<input type="text" name="api.bz" value="#(api.bz??)" lay-verify="requite" autocomplete="off" placeholder="请输入接口描述" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div style="text-align: center;">
				<button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
				#if(bEdit)
				<a href="xpApi/test_ui?method=#(api.name)" class="layui-btn layui-btn-primary">测试</a>
				#end
				<a href="xpApi" class="layui-btn layui-btn-primary">返回</a>
			</div>
		</div>
	</div>
	<script>
		
			layui.use(['form', 'laydate'], function(){
				var form = layui.form
				,layer = layui.layer
				,laydate = layui.laydate;


				//自定义验证规则
// 				form.verify({
// 					userName: function(value){
// 						if(value.length < 5){
// 							return '用户名至少得5个字符啊';
// 						}
// 					},
// 				});

				//监听指定开关
// 				form.on('select(changeID)', function(data){
// 					if(data.value!="#(departmentID)")
// 					{
// 						$("#role").css("display","none");
// 						$("input[name='role']").removeAttr("checked");
// 						form.render('checkbox');
// 					}
// 					else
// 					{
// 						if($("#type").val()=="2")
// 							$("#role").css("display","block");
// 						else
// 						{
// 							$("#role").css("display","none");
// 							$("input[name='role']").removeAttr("checked");
// 						}
// 						form.render('checkbox');
// 					}
// 				});
				
				//监听指定开关
// 				form.on('select(changetype)', function(data){
// 					if(data.value=="1")
// 					{
// 						$("#role").css("display","none");
// 						$("input[name='role']").removeAttr("checked");
// 						form.render('checkbox');
// 					}
// 					else
// 					{
// 						if($("#departmentID").val()=="#(departmentID)")
// 							$("#role").css("display","block");
// 						else
// 						{
// 							$("#role").css("display","none");
// 							$("input[name='role']").removeAttr("checked");
// 						}
// 						form.render('checkbox');
// 					}
// 				});
				
				//监听指定开关
				form.on('switch(switchState)', function(data){
// 					$("#userstate").val(this.checked ? '1' : '0');
				});

				//监听提交
				form.on('submit(demo1)', function(data){
						//layer.alert(JSON.stringify(data.field), { title: '最终的提交信息' });
						//return false;
// 					$("#userID").removeAttr("disabled");
				});
			});
			
		$(function(){		
			#if(msg)
				xpsoft.msg('#(msg)');
			#end
		});			
		
	</script>
</fieldset>
